import request from '@/utils/request'
const api_name_test = '/test'
export default {
  // 添加试题
  addTest(testName, trainId, answerIds, isMultilychoice, difficulty) {
    return request({
      url: `${api_name_test}/addTest`,
      method: 'post',
      data: testName, trainId, answerIds, isMultilychoice, difficulty
    })
  },
  //查找试题
  findTest(currentPage, pageSize, test) {
    return request({
      url: `${api_name_test}/findTest/${currentPage}/${pageSize}`,
      method: 'post',
      data: test
    })
  },

   //查询这个用户的这个培训的成绩 通过用户id 培训id
   findTestScore(userId,trainId){
     return request({
       url:`${api_name_test}/findTestScore/${userId}/${trainId}`,
       method:'get'
       
     })
    },
     //根据id删除试题
     deleteById(id){
       return request({
        url:`${api_name_test}/deleteById/${id}`,
        method:'delete',
        data:id
       })
    }
}